package mysql

import "gorm.io/gorm"

type Regi struct {
	gorm.Model
	Name       string `grom:"type:varchar(30);not null;comment:'患者姓名'"`
	StatusCard string `gorm:"type:varchar(30);not null;comment:'证件类型'"`
	WeiXiName  string `gorm:"type:varchar(30);not null;comment:'微信昵称'"`
	Area       string `gorm:"type:varchar(30);not null;comment:'就诊人地址'"`
	RegiCode   string `gorm:"type:varchar(30);not null;comment:'就诊卡号'"`
	CardCode   string `gorm:"type:varchar(30);not null;comment:'证件号码'"`
	PhoneCode  string `gorm:"type:varchar(30);not null;comment:'手机号码'"`
	Image      string `gorm:"type:varchar(500);not null;comment:'患者头像'"`
	Ties       string `gorm:"type:varchar(30);not null;comment:'关系'"`
}

func (r *Regi) RegiCreate(db *gorm.DB) error {
	return db.Debug().Create(r).Error
}

func (r *Regi) RegiShow(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(r).Error
}

func (r *Regi) RegiDel(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).Delete(r).Error
}
